/**
 * Copyright (c) suzuki ryoutoku
 * See this code regarding the Apache License Version 2.0
 * @file Log.h
 */

//=============================================================================
//	Protected multiple include file
//=============================================================================
#ifndef LOG_H
#define LOG_H

//=============================================================================
//	Preprocessor
//=============================================================================
#include "include/declare.h"
#include <fstream>
#include <cstdio>
#include <cstdarg>
using namespace std;


//=============================================================================
//	Define class
//=============================================================================
/**
 * Log system manager class.
 * \note
 * [Feature]
 * Designing of this class is underlying singleton pattern.
 * [Usage]
 * 1. When the program start, you must call initialize method at once.
 * 2. When you are going to log, you call print method.
 *
 * @author suzuki ryoutoku 
 * @date 2008-1-3
 * @version 1.0
 */
class library::log::LogManager
{
private:
  FILE*				  m_fp;
  char	m_logfilename[256];
  char	 m_logdirname[256];

private:
  LogManager();

public:
  ~LogManager();
  void print(const char* format, ...);
  void initialize(const string& arg);
  char* storeTime(char* arg);
  
private:
  static LogManager instance;

public:
  static LogManager* GetInstance(void);
};


//=============================================================================
//	Protected multiple include file
//=============================================================================
#endif
